package com.yc.sole.financial.request;

import com.yc.sole.common.enums.PaymentMethod;
import com.yc.sole.framework.validate.SaveGroup;
import com.yc.sole.framework.validate.UpdateGroup;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * Request对象
 *
 * @author yizuomin
 * @date 2024-03-08
 **/
@Data
public class ReceiptReq implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @NotNull(groups = {UpdateGroup.class})
    private Long id;
    /**
     * 回款金额
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    @DecimalMin(value = "0.01")
    private BigDecimal amount;
    /**
     * 客户id
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private Long customerId;
    /**
     * 关联订单id
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private Long orderId;
    /**
     * 收款方式 0现金支付 1微信支付 2支付宝支付 3银行卡转账
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private PaymentMethod receiptMethod;
    /**
     * 收款日期
     */
    @Length(max = 10, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String receiptDate;
    /**
     * 备注
     */
    @Length(max = 255, groups = {SaveGroup.class, UpdateGroup.class})
    private String remark;
}
